package servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.ListPricingDao;

import util.DbUtil;
import vo.ListPricing;
import vo.ListUser;

public class ListPricingServlet extends HttpServlet {

	DbUtil dbUtil=new DbUtil(); 
	ListPricingDao listpricingdao=new ListPricingDao();
	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		try{
			Connection con=null;
			con=dbUtil.getCon();
			ListPricing listpricing=listpricingdao.getListPricing(con);
			List<ListPricing> list=new ArrayList<ListPricing>();
			list.add(listpricing);
			request.setAttribute("list", list);
			
		}catch(Exception e){
			e.printStackTrace();
		}
		request.getRequestDispatcher("listPricing.jsp").forward(request,response);
	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doGet(request,response);
	}

}
